import request from '@/utils/request'
import { getItem } from '@/utils/auth'

export function fetchParameterUserList(data) {
  return request({
    url: '/cloud-system/getParameterUserList',
    method: 'post',
    data
  })
}

export function fetchParameterUserDetail(data) {
  return request({
    url: '/cloud-system/getOneParameterUserDetail',
    method: 'post',
    data
  })
}

export function createOneParameterUser(data) {
  return request({
    url: '/cloud-system/createOneParameterUser',
    method: 'post',
    data
  })
}

export function updateParameterUser(data) {
  return request({
    url: '/cloud-system/updateOneParameterUser',
    method: 'post',
    data
  })
}

export function deleteOneParameterUser(data) {
  return request({
    url: '/cloud-system/deleteOneParameterUser',
    method: 'post',
    data
  })
}
export function batchDeleteParameterUser(data) {
  return request({
    url: '/cloud-system/batchDeleteParameterUser',
    method: 'post',
    data
  })
}

export function lockParameterUser(data) {
  return request({
    url: '/cloud-system/lockOneParameterUser',
    method: 'post',
    data
  })
}

export function unlockParameterUser(data) {
  return request({
    url: '/cloud-system/unlockOneParameterUser',
    method: 'post',
    data
  })
}

export function batchLockParameterUser(data) {
  return request({
    url: '/cloud-system/batchLockParameterUser',
    method: 'post',
    data
  })
}

export function batchUnLockParameterUser(data) {
  return request({
    url: '/cloud-system/batchUnLockParameterUser',
    method: 'post',
    data
  })
}

export function createParameterSystemList(data) {
  return request({
    url: '/cloud-system/createParameterSystemList',
    method: 'post',
    data
  })
}

export function createParameterOrganizationList(data) {
  return request({
    url: '/cloud-system/createParameterOrganizationList',
    method: 'post',
    data
  })
}

export function createParameterSiteList(data) {
  return request({
    url: '/cloud-system/createParameterSiteList',
    method: 'post',
    data
  })
}

export function createParameterApplicationList(data) {
  return request({
    url: '/cloud-system/createParameterApplicationList',
    method: 'post',
    data
  })
}

export function createParameterUserList(data) {
  return request({
    url: '/cloud-system/createParameterUserList',
    method: 'post',
    data
  })
}

export function deleteObjectByParameterID(data) {
  return request({
    url: '/cloud-system/deleteObjectByParameterID',
    method: 'post',
    data
  })
}

export function getParameterList(baseParam) {
  const data = Object.assign(JSON.parse(getItem('baseParam')), baseParam)
  return request({
    url: '/cloud-system/getParameterList',
    method: 'post',
    data: data
  })
}

